package com.yks.pls;

public class SysytemNativeDemo {
    public static void main(String[] args) {
        int[] nums1 = new int[]{1,2,3,4,0,0};
        int[] nums2 = new int[]{5,6};
        merge(nums1,4,nums2,2);
    }

    public static void  merge(int[] nums1, int m, int[] nums2, int n) {
        int i=0;
        for (int e : nums2) {
            for (int i1 = i; i1 < nums1.length; i1++) {
                if(e>nums1[i1]){
                    i++;
                    if(i1==m){
                        e=nums1[i1];
                        m++;
                    }
                }else {
                    System.arraycopy(nums1,i1,nums2,i1+1,nums1.length-i1-1);
                }
            }
        }
    }
}
